# -*- coding:utf-8 -*-
# @FileName  :t16.py
# @Time      :2021/7/15 16:03
import base64
import io
import json
import sys
import time
from urllib import parse
from urllib.parse import quote
from fontTools.ttLib import TTFont
#popen.py
import subprocess
from functools import partial

subprocess.Popen = partial(subprocess.Popen, encoding="utf-8")
import execjs
import requests
import xmltodict

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='gb18030')


def jie(w):
    with open('t6.js', 'r', encoding='utf-8') as f:
        jstext = f.read()
    ctx = execjs.compile(jstext)
    result = ctx.call('ookk', int(s),w)
    return result


def main(m, cc):
    global num, count
    kv = {'User-Agent': 'yuanrenxue.project', 'cookie': 'sessionid=597pxh476ux93chh4bh3dhavz6l033pm;'}
    # par = {
    #     'page': m,
    #     'm': cc,
    #     'q': f'1-{s}|',
    # }
    par = (
        ('page', m),
        ('m', cc),
        ('q', f'1-{s}|'),
    )
    # print(par)
    r = requests.get(f'https://match.yuanrenxue.com/api/match/6',params=par, headers=kv, verify=False).json()
    print(r)
    for i in r['data']:
        num += i['value'] * 24


if __name__ == "__main__":
    num = 0

    # input(jie(1))
    for i in range(1, 6):
        s = str(int(time.time()) * 1000)
        main(i, jie(1))
        # input('1111')
    print(num)
